package qing.entity;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.NotBlank;

@Entity
@Table
public class Node  extends AbstractEntity<String> {

	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	private String id;	
	
	//貌似解决并发控制数据问题
	@Version
	private Integer version;
	
	private boolean deleted;
	
	//时间戳
	@Temporal(value=TemporalType.TIMESTAMP)
	private Date dateCreated;
	
	@NotBlank
	private String title;
	
	private String subtitle;
	
	//调用索引
	private String call;
	
	private String pid;
	
	private int layer=1;
	
	private int taxis=0;
	
	private String adduser;
	
	
	@Column(updatable = false,nullable=false,length=20)
	private Date addtime= new Date();
	
	@Basic(fetch=FetchType.LAZY)
	@Column(columnDefinition="nvarchar(MAX)")
	private String content;
	private String imgurl;
	private String linkurl;
	
	private int linktype=0;
	
	@ManyToOne( cascade= {CascadeType.PERSIST,CascadeType.MERGE})
	@JoinColumn(name="tplchannel")
	private Tpl tplch;
	
	@ManyToOne(  cascade= {CascadeType.PERSIST,CascadeType.MERGE})
	@JoinColumn(name="tplcon")
	private Tpl tplcon;


	public Tpl getTplcon() {
		return tplcon;
	}

	public void setTplcon(Tpl tplcon) {
		this.tplcon = tplcon;
	}

	private String summary;
	
	private String specialid;
	
private String path;
	
	private boolean istp=false;
	
	private boolean isfile=false;
	
	private boolean ishtml=false;
	
	private boolean ispl=false;
	
	private int isright=0;
	
	private String pwd;



	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	public Date getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSubtitle() {
		return subtitle;
	}

	public void setSubtitle(String subtitle) {
		this.subtitle = subtitle;
	}



	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public int getLayer() {
		return layer;
	}

	public void setLayer(int layer) {
		this.layer = layer;
	}

	public int getTaxis() {
		return taxis;
	}

	public void setTaxis(int taxis) {
		this.taxis = taxis;
	}

	public String getAdduser() {
		return adduser;
	}

	public void setAdduser(String adduser) {
		this.adduser = adduser;
	}

	public Date getAddtime() {
		return addtime;
	}

	public void setAddtime(Date addtime) {
		this.addtime = addtime;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getImgurl() {
		return imgurl;
	}

	public void setImgurl(String imgurl) {
		this.imgurl = imgurl;
	}

	public String getLinkurl() {
		return linkurl;
	}

	public void setLinkurl(String linkurl) {
		this.linkurl = linkurl;
	}

	public int getLinktype() {
		return linktype;
	}

	public void setLinktype(int linktype) {
		this.linktype = linktype;
	}

	


	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public String getSpecialid() {
		return specialid;
	}

	public void setSpecialid(String specialid) {
		this.specialid = specialid;
	}



	public String getCall() {
		return call;
	}

	public void setCall(String call) {
		this.call = call;
	}

	public boolean isIstp() {
		return istp;
	}

	public void setIstp(boolean istp) {
		this.istp = istp;
	}

	public boolean isIsfile() {
		return isfile;
	}

	public void setIsfile(boolean isfile) {
		this.isfile = isfile;
	}

	public boolean isIshtml() {
		return ishtml;
	}

	public void setIshtml(boolean ishtml) {
		this.ishtml = ishtml;
	}

	public boolean isIspl() {
		return ispl;
	}

	public void setIspl(boolean ispl) {
		this.ispl = ispl;
	}

	public int getIsright() {
		return isright;
	}

	public void setIsright(int isright) {
		this.isright = isright;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public Tpl getTplch() {
		return tplch;
	}

	public void setTplch(Tpl tplch) {
		this.tplch = tplch;
	}


	
	
	
	
}
